package com.saycode.common;

import com.xiaoleilu.hutool.crypto.digest.DigestUtil;

import java.util.Date;

/**
 * Created by zhangyanhui on 2017/6/19.
 */
public class MethodUtil {
    /**
     * 加密
     * @param content
     * @return
     */
    public static String encrypt(String content){
        return DigestUtil.sha1Hex(content);
    }

    public static Long getId(){
        return Long.valueOf(new Date().getTime() +""+ (int)(Math.random() * 1000));
    }

    public static boolean isNull(String str){
        if (str == null || "".equals(str)){
            return true;
        }
        return false;
    }
}
